<template>
  <div id="app">
    <el-switch :key="item.id" v-for='(item,index) in tableData' v-model='item.value' :inactive-value='false' :action-value='true' @change="handleChange"></el-switch>
  </div>
</template>
<script>
export default {
  data(){
    return {
      tableData:[
        {
          id:1,
          title:'首页',
          value:true
        },{
          id:2,
          title:'产品',
          value:false
        },{
          id:3,
          title:'公司介绍',
          value:true
        }
      ]
    }
  },
   methods:{
      handleChange:function(value){
        console.log(value);
      }
    }
}
</script>
<style>
*{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
</style>
